import React, { Component } from 'react';
import {
    StyleSheet,
    View,
    Text,
    Image,
    TouchableOpacity,
    Dimensions,
    ScrollView, StatusBar,
} from 'react-native';
import { WebView } from 'react-native-webview'
// 取得屏幕的宽高Dimensions
const { width, height } = Dimensions.get('window');


export default class Introduce extends Component {
    constructor(props) {
        super(props);
        this.state = {
            Content:null,
        };
    }
    static navigationOptions = {
        title: '玩法介绍',
        //header: null,  //隐藏顶部导航栏
        //tabBarVisible: false, // 隐藏底部导航栏
        headerStyle: {
            backgroundColor: '#d0162e',
            paddingTop:18
        },
        headerTintColor: '#fff',
        headerTitleStyle: {
            //fontWeight: 'bold',
        },
    }
    componentDidMount() {
        const { navigation } = this.props;
        let Content = navigation.getParam("Content");
        this.setState({
            Content:Content
        })
    }
    renderLoadingView() {
        return (
            <View style={styles.container}>
                <Text>Loading movies...</Text>
            </View>
        );
    }
    render() {
        let {Content} = this.state;
        if (Content==null) {
            return this.renderLoadingView();
        }
        return (
            <View style={styles.container}>
                <StatusBar translucent={ true } backgroundColor="transparent" />
                <ScrollView style={{width:width,height:height}}>
                    <Text style={{padding:16,lineHeight:24}}>{Content}</Text>
                </ScrollView>
            </View>
        );
    }
}
const styles = StyleSheet.create({
    container: {
        flex: 1,
        alignItems: 'center',
        backgroundColor: '#fff',
    },
});